﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using Microsoft.Xna.Framework;
using Microsoft.Xna.Framework.Content;

namespace zEngine.ExtendedObjs
{
    public class ModelTag
    {

        /// <summary>
        /// Initializes a new instance of the SkinData class.
        /// </summary>
        public ModelTag(
            //BoundingSphere boundingSphere, BoundingBox boundingBox,
            List<Matrix> bindPose, 
            List<Matrix> inverseBindPose, 
            List<int> skeletonHierarchy,
            Dictionary<string, int> boneIndices)
        {
            BindPose = bindPose;
            InverseBindPose = inverseBindPose;
            SkeletonHierarchy = skeletonHierarchy;
            BoneIndices = boneIndices;
        }

        /// <summary>
        /// Only for XNA to deserialize
        /// </summary>
        public ModelTag()
        {
        }


        #region Fields
        [ContentSerializer]
        public Matrix[] BoneTransformation { get; private set; }
        [ContentSerializer]
        public BoundingSphere BoundingSphere { get; private set; }
        [ContentSerializer]
        public BoundingBox BoundingBox { get; private set; }

        /// <summary>
        /// Bindpose matrices for each bone in the skeleton,
        /// relative to the parent bone.
        /// </summary>
        [ContentSerializer]
        public List<Matrix> BindPose { get; private set; }


        /// <summary>
        /// Vertex to bonespace transforms for each bone in the skeleton.
        /// </summary>
        [ContentSerializer]
        public List<Matrix> InverseBindPose { get; private set; }


        /// <summary>
        /// For each bone in the skeleton, stores the index of the parent bone.
        /// </summary>
        [ContentSerializer]
        public List<int> SkeletonHierarchy { get; private set; }

        [ContentSerializer]
        public Dictionary<string, int> BoneIndices { get; private set; }
        #endregion
    }
}
